﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/BusPlannerMaster.master" AutoEventWireup="true" CodeFile="Planner.aspx.cs" Inherits="Pages_Planner" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  <div class="maincontainer">
      <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script src="../Scripts/Planner.js" type="text/javascript"></script>
  <asp:ScriptManager ID="ScriptManager2" runat="server">
</asp:ScriptManager>
          
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" 
          OnLoad="UpdatePanel1_Load" ChildrenAsTriggers="true"  UpdateMode="Conditional" 
          onprerender="UpdatePanel1_PreRender" >
                    <Triggers>        
                        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" /> 
                        <asp:AsyncPostBackTrigger ControlID="btnClearAll" EventName="Click" /> 
                        <asp:AsyncPostBackTrigger ControlID="lstStations" EventName="SelectedIndexChanged" />
                    </Triggers>    
                    <ContentTemplate>
                        <div class="container">

                            <p>
                                Тип на планирање:</p>
                            <div class="item">
                                <asp:ListBox Width="100%" ID="lstStations" runat="server" AutoPostBack="True" 
                                    onselectedindexchanged="lstStations_SelectedIndexChanged"></asp:ListBox>
                            </div>
                        </div>
                        <div class="infocontainer_busses">
                             <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Clicked" Text="Пребарај"/>
                             <asp:Button ID="btnClearAll" runat="server" OnClick="btnClearAll_Clicked" Text="Исчисти мапа" />
                                
                             <br />
                             Почетна станица:
                             <asp:Label ID="lblStartStation" runat="server"></asp:Label>
                             <br />
                             Крајна станица:
                             <asp:Label ID="lblEndStation" runat="server" Text=""></asp:Label>
                             <br />
                             <div class="separator" ></div>
                            <asp:DataList ID="lstBusses" runat="server" >
                            <ItemTemplate>
                                <ul class="info_item">
                                    <li>
                                        <span>Автобус бр: </span>
                                        <asp:Label ID="lblBusNo" runat="server" Text='<%# ((Bus)Eval("Bus"))._busNo  %>'></asp:Label>
                                    </li>
                                    <li>
                                        <span>Пристига(во период од 1 час): </span>
                                        <asp:Label ID="lblTimeStart" runat="server" Text='<%# Eval("StartTime")%>'></asp:Label>
                                    </li>
                                    <li>
                                        <span>Времетрање на патувањето: </span>
                                        <asp:Label ID="lblTimeBetween" runat="server" Text='<%# Math.Ceiling((double)Eval("TimeToSecondStation"))+" минути"%>'></asp:Label>
                                    </li>
                                </ul>
                                <div class="item_separator" ></div>
                            </ItemTemplate>
                            </asp:DataList>
                
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <div id="map_container">
                    <div id="map">
                    </div>
                    <input type="hidden" runat="server" id="markerA" name="markerA" value="" />
                    <input type="hidden" runat="server" id="markerB" name="markerA" value="" />
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" class="update_area">
                        <ProgressTemplate>
                                <div id="load_img">
                                    <img src="../images/ajax-loader.gif" alt="Loading..." />
                                </div>
                            </ProgressTemplate>
                    </asp:UpdateProgress>
                 </div>
            </div>
            <div id="main">
                <div id="content" class="left">
                    <div class="highlight">
                    </div>
                    <div class="projects">
                    </div>
                    <div id="sidebar" class="right">
                    </div>
                </div>
            </div>
</asp:Content>
